function changeTab(id)
{
  var tabNo=3;
  var tabArray=new Array();
  tabArray[1]="tab1";
  tabArray[2]="tab2";
  tabArray[3]="tab3";
   var tabContent=new Array();
  tabContent[1]="content1";
  tabContent[2]="content2";
  tabContent[3]="content3";
  
  for(i=1; i<=tabNo; i++)
  {
    if(i==id)
	{
	  
	  removeClass(document.getElementById(tabArray[i]),"rTb_deselect1");
	  removeClass(document.getElementById(tabArray[i]),"rTb_deselect2");
	  removeClass(document.getElementById(tabArray[i]),"rTb_active1");
	  if(tabNo==i)
	  {
	    
		document.getElementById(tabArray[i]).className="rTb_active1";
		addClass(document.getElementById(tabArray[i]),"rTb_active1");
		//alert(document.getElementById(tabArray[i]).className);
	  }	
	  else
	  {
		document.getElementById(tabArray[i]).className="rTb_active1";
		addClass(document.getElementById(tabArray[i]),"rTb_active1");
		//alert(document.getElementById(tabArray[i]).className);
	  }
	 document.getElementById(tabContent[i]).style.display="inline";
	 document.getElementById(tabContent[i]).style.backgroundColor="#fff";
	  
	}
	else
	 {
	   removeClass(document.getElementById(tabArray[i]),"rTb_deselect1");
	   removeClass(document.getElementById(tabArray[i]),"rTb_deselect2");
	   removeClass(document.getElementById(tabArray[i]),"rTb_active1");
	  if(tabNo==i)
	  {
	    addClass(document.getElementById(tabArray[i]),"rTb_deselect2");
		document.getElementById(tabArray[i]).className="rTb_deselect2";
		//alert(document.getElementById(tabArray[i]).className)
	  }
	  else
	  {
	    addClass(document.getElementById(tabArray[i]),"rTb_deselect1");	
		document.getElementById(tabArray[i]).className="rTb_deselect1";
		//alert(document.getElementById(tabArray[i]).className)
	  }	
		document.getElementById(tabContent[i]).style.display="none";
		document.getElementById(tabContent[i]).style.backgroundColor="#fff";
	 }
  }
}

function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));

}



function addClass(ele,cls) {

if (!this.hasClass(ele,cls)) ele.className += " "+cls;

}



function removeClass(ele,cls) {

if (hasClass(ele,cls)) {

var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');

ele.className=ele.className.replace(reg,' ');

}

}
